"""
@Time ： 2022/9/16 10:37
@Auth ： 陈杰 200320501042
@E-mail : 1612845322@qq.com
"""

# 元组赋值
t = ('westos', 11, 100)
name = t[0]
print(name)
t = ('westos', 11, 100)
# 序列赋值
name, age, score = t
print(name, age, score)
# 元组排序
score = (100, 89, 45, 78, 65)
# 从小到大排序
scores1 = sorted(score)
print(scores1)
# 降序排列
scores2 = sorted(score, reverse=True)
print(scores2)
students = [('john', 'A', 11), ('jane', 'B', 12), ('dave', 'B', 10)]
students2 = sorted(students, key=lambda s: s[2])
print(students2)
# 索引，统计次数
t = (1, 2.3, True, 'westos', 'westos')
print(t.count('westos'))
print(t.index(2.3))
